Repository navigation
Fix out-of-range group window shortcuts - #8411
wxasacoder wants to merge 8 commits into
Conversation
TestingAdded regression coverage for:
Focused tests:
Manual verificationTested in a live Omarchy session with two grouped windows:
screenrecording-2026-08-26_23-51-11.mp4 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Lua 5.5 exits 0 when a script it reads from a pipe errors, so `lua <<'LUA'` swallowed every failed assertion and the test passed with the fix reverted. `lua -` reads the same heredoc and exits 1 on an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed and tested on a disposable Omarchy VM (Hyprland 0.56.2) by Claude Opus 5.5. The fix works: with a two-window group, real Super+Alt+3 and Super+Alt+5 key presses show I pushed one commit to your branch, b203ddc. The new test could not fail: on Lua 5.5, This fixes #12085. #10693 makes the same change later without a test, and #12155 includes it among five unrelated fixes. This one is the one to take forward. One side effect, found by reading the code rather than running it: as Lua functions, these five binds can no longer be run from the keybindings menu ( No second opinion ran. Codex Medium, the configured reviewer, answered a ping but refused the review because today's review budget is used up. For the same reason the classification at the new head could not be confirmed, so the |
The pcall guard this branch added made the binds Lua functions, and the keybindings menu's scanner records a dispatcher only for an __omarchy_dispatcher table, a string, or an o.bind_commands lookup (bin/omarchy-menu-keybindings). A function matched none of those, so the cached dispatcher came back empty, overwrote the __lua one that `hyprctl binds` reports, and dispatch_binding returned 1. Picking "Switch to group window 2" from the menu did nothing even when the group had a second window. The pcall was also the wrong guard. Hyprland reports the rejection through its dispatcher result rather than by raising a Lua error, so it would still have notified. Check the focused window's group size before dispatching, so nothing is dispatched past the end of the group and Hyprland has nothing to reject, and register the equivalent command in o.bind_commands so the menu can still run the bind. Same approach as omacom#15100. The window.group.size shape is the one omarchybot verified on a Hyprland 0.56.2 VM against omacom#8411. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Hi @ryanrhughes, thanks for taking a look at this PR! I noticed that #15100 addresses the same issue and also includes a fix for compatibility with the Super+K shortcut menu. I'm happy to update this PR to cover that case as well. Would you prefer that I continue improving this PR, or should we move forward with #15100 instead? Thanks! |
As Lua functions, Super+Alt+1 to 5 gave the keybindings menu nothing it could run. The check moves into o.switch_group_window, and each bind registers `hyprctl eval 'o.switch_group_window(n)'` in o.bind_commands, the way o.launch_terminal does, so the entries stay runnable from Super+K. Co-Authored-By: Omarchybot <317366263+omarchybot@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryGuards numbered group shortcuts so unavailable positions do nothing.
No new actionable issues found. Tests were inspected, not run. Reviews (3) · Last reviewed commit: "Stub o.workspaces in the group binding t..." · Reviewed by Greptile |
|
@wxasacoder, thanks for asking about #15100. You don't need to do anything: its one addition, keeping these binds runnable from the Super+K keybindings menu, is now on this branch, so this pull request covers both. It was first to the fix, and it carries the fix forward. #15100 is omabot's own pull request, so you keep the credit for this one. Two commits went onto your branch. 0c5809e merges current Tested on a disposable Omarchy VM (Hyprland 0.56.2), with Hyprland loading this branch's config and keys pressed through a virtual keyboard:
Codex Medium reviewed the change and found no defects, checking the This links #12085, which it fixes. #12155 includes the same change among other fixes. It's waiting on the maintainer now. |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Current quattro builds tiling.lua's workspace binds from o.workspaces, which monitor-workspaces.lua defines and this test never loads, so once merged the test died at tiling.lua:25 before reaching a group bind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@wxasacoder, thanks for adding the ungrouped-window case from Greptile's suggestion. It holds:
Tested on a disposable Omarchy VM, with Hyprland loading this branch and keys pressed through a virtual keyboard:
Codex Medium reviewed the merged branch and found no defects. It confirmed that the stub only lets This fixes #12085. #12155 bundles the same change with unrelated fixes, and #15100 is now covered here. GitHub is holding this branch's CI until a maintainer approves the workflow run. After that, it waits on the maintainer. |
Problem
Omarchy binds
Super + Alt + 1throughSuper + Alt + 5directly tohl.dsp.group.active.When the active group contains fewer windows than the selected index, Hyprland returns an

Index out of rangeLua runtime error. For example, with two windows in a group,Super + Alt + 1andSuper + Alt + 2work, but pressingSuper + Alt + 3produces an error notification. Repeated key presses can fill the screen with these notifications.Solution
Resolve the active window and its group when the shortcut is pressed, then dispatch the group switch only when the requested index is within
group.size.Valid group window shortcuts retain their existing behavior. Shortcuts targeting unavailable group positions, or used outside a window group, now safely do nothing.
This uses Hyprland's Lua window and group APIs directly instead of catching or matching runtime error messages.
Testing
bash test/shell.d/hyprland-group-bindings-test.sh.bash test/shell.d/hyprland-binding-conflicts-test.sh.Fixes #12085